#include <iostream>
#include <signal.h>
#include <sys/select.h>
#include <unistd.h>
using namespace std; 

fd_set fset; 
void handle(int s){

	cout << " handle \n" ; 
}
int main(){
	cout << getpid() << endl;
	signal(SIGUSR1,handle); 
	FD_SET(0,&fset); 
	int r = select(1, &fset,0,0,0); 
	cout << r << endl;
	cout << " over select \n" ; 
	char buf[10];
	read(0,buf,10);
	cout << "over read" << endl;
	
}
